/**
 * Created by aa on 2016/9/24.
 */
var React = require('react');
var ReactDom = require('react-dom');
var HkfslineMap=require('./components/pc/HkfslineMap.jsx');

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}

reqwest({
    url: '/api/getFundNavSeries?fundCode='+getQueryString('fundCode'),
    method: 'get',
    contentType: 'application/json'
})
    .then(function (data) {
        ReactDom.render(<div>
            <HkfslineMap data={data} width="580px" height="300px"></HkfslineMap>
        </div>, document.getElementById('HkfsFundDetailMap'));
    })
    .fail(function (err, msg) {
        alert('获取数据出错');
    })
